home *** CD-ROM | disk | FTP | other *** search
- #include "Math.h"
-
- #define NIL 0L
- #define Min(x, y) ((x) < (y) ? (x) : (y))
-
- void HandleActivateEvent( WindowPtr w, Boolean activate, EventRecord *event);
- pascal void SliderClickProc( ControlRef c, short part);
- void UpdateScores( DialogPtr d);
- void GetSavedValues( DialogPtr dlg);
- short GetPrefFile();
- void AdjustRectangle( Rect *rc, Rect cnstr, short defW, short defH);
- void SetDialogFontSize( DialogPtr d, short fontNum, short fontSize);
-
- Handle ih;
- Rect ir;
- short it;
-
-
- /*******************************************************************************
-
- ••• GetDValue 21/3/1994 at 17:04 •••
-
- *******************************************************************************/
- short GetDValue( DialogPtr thisDialog, short theItem)
- {
- short theCVal;
-
- GetDItem( thisDialog, theItem, &it, &ih, &ir);
- theCVal = GetCtlValue( (ControlHandle) ih);
- return (theCVal);
- }
-
-
- /*******************************************************************************
-
- ••• SetDValue 21/3/1994 at 17:40 •••
-
- *******************************************************************************/
- void SetDValue( DialogPtr thisDialog, short theItem, short theCVal)
- {
- short theOldCVal;
-
- GetDItem( thisDialog, theItem, &it, &ih, &ir);
- theOldCVal = GetCtlValue( (ControlHandle) ih);
- if ( theCVal == theOldCVal) return;
-
- SetCtlValue( (ControlHandle) ih, theCVal);
- if ( it == 7) Draw1Control( (ControlHandle) ih);
- }
-
-
- /*******************************************************************************
-
- ••• BadAlert •••
-
- *******************************************************************************/
- void BadAlert( short errNumber)
- {
- Str255 dummy;
-
- GetIndString( dummy, 129, errNumber);
- ParamText( dummy,"\p","\p","\p");
- it = StopAlert( 666, 0L);
- ExitToShell();
- }
-
-
- /*******************************************************************************
-
- ••• InitScoreCard 9/7/1994 at 15:47 •••
-
- *******************************************************************************/
- void InitScoreCard()
- {
- DialogPtr d = GetNewDialog( 129, NIL, (DialogPtr) -1);
- if (!d) BadAlert(4);
-
- ShowWindow(d); SelectWindow(d);
- }
-
-
- /*******************************************************************************
-
- ••• HandleOSEvent •••
-
- *******************************************************************************/
- short HandleOSEvent( EventRecord *event)
- {
- DialogPtr d;
- short var;
- Boolean resume = 0;
-
-
- InitCursor();
- if (( event->message & resumeFlag) != 0) resume = 1;
- d = FrontWindow();
- if (d)
- {
- HandleActivateEvent( d, resume, event);
- }
- return (!resume);
- }